{if $row.check_status=="2"}
<div class="alert alert-danger-light">
    <p><i class="fa fa-info"></i> {:__('已经审核通过的只能修改备注')}</p>
</div>
{/if}
<style>
    .form-group .col-sm-2{
        min-width: 140px;
    }
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="row">

        <div class="col-md-6 col-xs-12 form-group business_id_div ">
            <label for="c-contract_id" class="control-label col-xs-12 col-sm-2">{:__('选择合同')}:</label>
            <div class="col-xs-12 col-sm-8">

                <div class="clickbox">

                    <label class="control-label">
                        {:isset($row->contract)?$row->contract['name'].'-'.$row->contract['number']:__('选择合同')}
                    </label>
                </div>

            </div>
        </div>

        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-invoice_body" class="control-label col-xs-12 col-sm-2">{:__('开票主体')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-invoice_body" data-rule="required" type="text" class="form-control" name="row[invoice_body]" value="{$row.invoice_body}"/>
            </div>
        </div>

        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-invoice_name" class="control-label col-xs-12 col-sm-2">{:__('发票抬头')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-invoice_name" data-rule="required" type="text" class="form-control" name="row[invoice_name]" value="{$row.invoice_name}"/>
            </div>
        </div>

        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-invoice_issue" class="control-label col-xs-12 col-sm-2">{:__('抬头类型')}:</label>
            <div class="col-xs-12 col-sm-8">
                {:build_radios('row[invoice_issue]', ['1'=>__('企业'), '2'=>__('个人'), '3'=>__('事业单位')],$row['invoice_issue'])}
            </div>
        </div>
        <div class="invoice_issue" {if $row['invoice_issue']=='2'}style="display: none"{/if}>
            <div class="col-md-6 col-xs-12 form-group">
                <label for="c-invoice_type" class="control-label col-xs-12 col-sm-2">{:__('发票类型')}:</label>
                <div class="col-xs-12 col-sm-8">
                    {:build_radios('row[invoice_type]', ['1'=>__('增值税普票'), '2'=>__('增值税专票')],$row['invoice_type'])}
                </div>
            </div>
            <div class="col-md-6 col-xs-12 form-group">
                <label for="c-register_no" class="control-label col-xs-12 col-sm-2">{:__('统一社会信用代码')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-register_no"  type="text" class="form-control" name="row[register_no]" value="{$row.register_no}"/>
                </div>
            </div>

            <div class="col-md-6 col-xs-12 form-group">
                <label for="c-bank_name" class="control-label col-xs-12 col-sm-2">{:__('开户行名称')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-bank_name"  type="text" class="form-control" name="row[bank_name]" value="{$row.bank_name}"/>
                </div>
            </div>
            <div class="col-md-6 col-xs-12 form-group">
                <label for="c-bank_name" class="control-label col-xs-12 col-sm-2">{:__('开户账号')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-bank_no"  type="text" class="form-control" name="row[bank_no]" value="{$row.bank_no}"/>
                </div>
            </div>

        </div>

        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('开票金额')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-money"  type="number" data-rule="required" class="form-control" name="row[money]" value="{$row.money}"/>
                <span class="help-block hepl-money">合同金额：{$row.contract.money},已收款：{$row.contract.return_money},已开票：{$row.contract.invoice_money}</span>

            </div>
        </div>
        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-tax_rate" class="control-label col-xs-12 col-sm-2">{:__('开票税率')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-tax_rate"  type="number" data-rule="required" class="form-control" name="row[tax_rate]" value="{$row.tax_rate}"/>
                <span class="help-block">不用输入%号</span>
            </div>
        </div>
        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('发票附件')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-image" class="form-control" size="50" name="row[files]" type="text" value="{$row.files}" placeholder="">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="*" data-multiple="true" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('上传')}</button></span>

                    </div>
                    <span class="msg-box n-right" for="c-image"></span>
                </div>
                <ul class="row list-inline plupload-preview" id="p-image"></ul>
            </div>
        </div>

        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('开票内容')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-content"  type="text" class="form-control" name="row[content]" value="{$row.content}"/>
            </div>
        </div>

        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-email" class="control-label col-xs-12 col-sm-2">{:__('接收邮箱')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-email"  type="text" class="form-control" name="row[email]" value="{$row.email}"/>
                <span class="help-block">可空，输入客户邮箱完成开票时，会把附件自动发送给客户。</span>
            </div>
        </div>

        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-user_name" class="control-label col-xs-12 col-sm-2">{:__('收件人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-user_name"  type="text" class="form-control" name="row[user_name]" value="{$row.user_name}"/>
                <span class="help-block">如需要邮寄请填写</span>
            </div>
        </div>
        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-user_phone" class="control-label col-xs-12 col-sm-2">{:__('手机')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-user_phone"  type="text" class="form-control" name="row[user_phone]" value="{$row.user_phone}"/>
                <span class="help-block">如需要邮寄请填写</span>
            </div>
        </div>
        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-user_address" class="control-label col-xs-12 col-sm-2">{:__('邮寄地址')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-user_address"  type="text" class="form-control" name="row[user_address]" value="{$row.user_address}"/>
                <span class="help-block">如需要邮寄请填写</span>
            </div>
        </div>


        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-remarks" class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-remarks" class="form-control" name="row[remarks]">{$row.remarks}</textarea>
            </div>
        </div>


        {if $row.check_status neq '2'}
        <div class="col-md-6 col-xs-12 form-group">
            <label for="c-flow_admin_id" class="control-label col-xs-12 col-sm-2">{:__('审批人')}:</label>
            <div class="col-xs-12 col-sm-8">
                {if($flow)}
                <input id="c-flow_admin_id"  value="{$row.flow_admin_id}"  data-source="facrm/common/selectpage/model/admin/type/all" data-field="nickname" data-multiple="true" {if $row.check_status=="2"}disabled{/if}  {$flow->config==1?'disabled ':'data-rule="required"'}
                class="form-control selectpage" name="row[flow_admin_id]" type="text" value="{if $flow->config==1}{$flow->step[0]['admin_ids']}{/if}">
                {else/}
                <label  class="control-label">审批流程已被删除</label>
                {/if}
            </div>
        </div>
        {/if}
    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>







